/**
 * @author (Jeff Thomas) 
 * @version (09.13.2007)
 */
import java.util.*;
public class SumMax
{
    public static void main(String[] args) {
        Scanner total = new Scanner(System.in);
        System.out.print("How many integers? ");
        int x = total.nextInt();
        Scanner number = new Scanner(System.in);
        int sum = 0;
        int max = 0;
        
        for (int i = 1; i <= x; i++) {
            System.out.print("Next integer? ");
            int y = number.nextInt();
            if (y > max) {
                max = y;
            }
            sum += y;
        }
        
        System.out.println();
        System.out.println("Sum = " + sum);
        System.out.println("Max = " + max);
    }
}
